<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author:LJQ <liujiqi@etrol.com>
// +-----------------------------------------------------------------------

namespace app\common\model;

use app\common\model\Base;
/**
 * 日志管理
 */
class Logs extends Base{
	protected $name = 'logs';
	protected $createTime = 'createTime';
	protected $updateTime = 'updateTime';

	public function user(){
		return $this->hasOne('User','id','operatorId');
	}
	
	public function getCreateTimeAttr($value,$data){
		if($data['createTime']){
			return date('Y-m-d H:i:s',$data['createTime']);
		}
	}

	public function getIpAttr($value,$data){
		if($data['ip']){
			return long2ip($data['ip']);
		}
	}
	
	
}